package creational.singleton;

/**
 * @Description: 懒汉式2
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Singleton4 {
    private static Singleton4 instance;

    private Singleton4() {

    }

    public static synchronized Singleton4 getInstance() {
        if (instance == null) {
            instance = new Singleton4();
        }
        return instance;
    }
}
